<template>
  <div class="remarks-style">
    <div class="close-box" :class="{ 'close-2': isMobile }" @click="store.setChildRemarksShow(false)"></div>

    <div
      class="remarks-style-conetnt"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style12/scrollBcakground1Marsk.webp'})`,
      }"
    >
      <div class="remarks-style-left">
        <div
          class="title-parent"
          :style="{
            backgroundImage: `url(${
              publicUrls + 'free/style12/scrollBcakground1Marsktitle1.png?imageView2/format/webp'
            })`,
          }"
        >
          <div class="title-center">
            {{ store.childTitle }}
          </div>
        </div>
        <div class="btm-box">
          <p class="subtitle" v-if="store.childSubTitle">{{ store.childSubTitle }}</p>
          <scrollBox
            color="rgba(51, 51, 51, 1)"
            v-if="Scrollheights && store.childRemarksShow"
            :remarks="store.childRemarks"
            :byid="100"
            :isTop="true"
            :tabbmScroll="getTabmComputed"
            :height="getScrollWComputed"
          >
            <template #solidBorder>
              <div class="solidBorder-child"></div>
            </template>
          </scrollBox>
        </div>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'styleOne',
});
</script>

<script setup lang="ts">
import { getMobileType } from '@/utils/getMoble';
import { publicUrls } from '@/utils/minxin';
import scrollBox from '../../../pages/public/copyright/scrollBox10.vue';
import { useProjectStore } from '@/store';
import { ref, computed, defineComponent } from 'vue';

const isMobile = ref(false);
isMobile.value = getMobileType();
const store = useProjectStore();
let viewportHeight = window.innerHeight;
const Scrollheights = ref();
Scrollheights.value = (viewportHeight / 900) * 560;
const getScrollWComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));

  let heights = (fontSizeNumber / 144) * 508;
  if (isMobile.value) {
    heights = (fontSizeNumber / 144) * 498;
  }
  return heights;
});
const getTabmComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 98;
  return heights;
});
</script>   

<style scoped lang="less">
.remarks-style {
  display: flex;
  flex-direction: column;
  position: relative;
  //   width: 100%;
  //   max-width: 1200px;
  width: 1200px;
  height: 750px;
  background: transparent;

  transform: translateZ(0px);
}
.remarks-style-conetnt {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0px 72px;
}

.remarks-style-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  // flex: 1;
  width: 100%;
  height: 100%;
}
.title-parent {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 1056px;
  height: 57px;
  background-repeat: repeat;
  background-size: auto 100%;
  margin-top: -10px;
  margin-bottom: 45px;
}

.title-center {
  width: 512px;
  height: 57px;
  font-family: Alimama DongFangDaKai;
  font-size: 32px;
  font-weight: 400;
  line-height: 57px;
  text-align: center;
  background: linear-gradient(90deg, #ffeabc 0%, #fec64b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.btm-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 842px;
  margin: 0 auto;
}
.subtitle {
  width: 100%;
  text-align: center;
  margin-bottom: 32px;
  font-family: PingFang SC;
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  text-align: center;
  color: rgba(180, 42, 41, 1);
}
.close-box {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 13px;
  right: 42px;
  width: 30px;
  height: 30px;
  z-index: 30;
}
.close-2 {
  top: 10px;
  right: 38px;
  width: 40px;
  height: 40px;
}
::v-deep {
  .solid-box-parent {
    width: 32px;
  }
  .unit-exbi-remarks-info-remarks {
    width: calc(100% - 6px);
  }
}

:deep(.solid-box-parent) {
  position: absolute;
  right: -17px;
  // margin-right: -32px;
}
:deep(.unit-exbit-null-remarks-info) {
  display: flex;
  align-items: center;
  height: 100%;
}
.solidBorder-child {
  width: 4px;
  height: 100%;
  background: rgba(241, 63, 51, 0.2);
  border-radius: 25px;
}
:deep(.solid-box-parent) {
  position: absolute;
  right: -32px;
}
:deep(.unit-exbi-remarks-info-remarks) {
  width: calc(100% - 1px);
}
::v-deep .templatestyle1-scroll-box-tumb {
  display: flex;
  justify-content: center;
  top: -4px;
  .scrollBar {
    width: 6px;
    // height: 100%;
    height: 98px;
    background: rgba(254, 214, 129, 1);
    border: 1px solid rgba(241, 63, 51, 0.42);
    border-radius: 25px;
    box-shadow: none;
  }
}
::v-deep .unit-exbi-remarks-info-remarks {
  p {
    color: rgba(100, 4, 0, 1);
    font-size: 16px;
    line-height: 32px;
    text-align: justify;
    font-weight: normal;
    padding-bottom: 20px;
  }
}
:deep(.remarks-style) {
}
</style>
